<template>
    <div class="refresh-button" style="padding:0 5px">
        <span v-if="loading">
            <i class="el-icon-loading"></i>
        </span>
        <el-button type="text" @click="onClick" v-else>
            <i class="el-icon-refresh"></i> 刷新
        </el-button>
    </div>
</template>

<script>
export default {
    name:'refresh-button',
    data() {
        return {
            fetching: false
        };
    },
    props: { loading: Boolean, default: false },
    methods: {
        onClick: function() {
            this.$emit("click", null);
        }
    }
};
</script>
<style scoped>
.refresh-button {
    display: inline-block;
}
</style>
